<?php include '../public/header.php' ?>
<?php include '../public/header_index.php' ?>
<style>
    .minyuan_red{padding: 4px;background-color: red;border-radius: 50%;font-size: 0!important;margin-right: 6px;position: relative;top: -4px;}
    .minyuan_lv{padding: 4px;background-color: #19BE6B;border-radius: 50%;font-size: 0!important;margin-right: 6px;position: relative;top: -4px;}
</style>
<body class="laytp-container">
<div id="opt_nav">
</div>

<div class="layui-card" id="search-form">
    <div class="layui-card-body">
        <form class="layui-form" id="TableSearchFormId" lay-filter="TableSearchForm" onkeydown="keyTableSearch('TableSearchForm', 'datalist')">
            <div class="layui-form-item">
                <div class="layui-row">
                    <div class="layui-col-md3">
                        <label class="layui-form-label">年度</label>
                        <div class="layui-input-block">
                            <input type="text" readonly name="year" id="year" placeholder="请输入" autocomplete="off" class="layui-input bdate_sea_one_y">
                        </div>
                    </div>
                    <div class="layui-col-md3">
                        <div class="layui-form-item search-div">
                            <div class="layui-form-item layui-inline">
                                <button class="laytp-btn laytp-btn-md laytp-btn-primary" id="TableSearchButton" type="button"><i class="layui-icon layui-icon-search"></i>查询</button>
                                <button class="layui-btn layui-btn-primary" onclick="listTableReset()" id="TableSearchReset" type="reset" ><i class="layui-icon layui-icon-refresh"></i>重置</button>
<!--                                <div id="search_open" onclick="toggle_search()">-->
<!--                                    <i class="layui-icon layui-icon-down"></i>展开-->
<!--                                </div>-->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

<div class="layui-card" id="table-card">
    <div class="layui-card-body">
        <div class="layui-row">
            <div class="layui-col-md12" id="table_list">
                <div class="layui-card-body">
                    <table id="datalist" lay-filter="datalist"></table>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="test-dropdown-toolbar-barDemo">
    <div class="tab-list-authbut">
        <a href="javascript:;" class="bar_opt" onclick="auth_but_func_show('查看','{{d.LAY_TABLE_INDEX}}')">查看</a>
    </div>
</script>
<script type="text/html" id="toolbarDemo">
    <div class = "layui-btn-container">
    </div>
</script>
<script>
    var year = (new Date()).getFullYear();
    $("#year").val(year);

    layui.use(["laytp",'laypage','table','dropdown','form','soulTable'], function () {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable;


        $('#TableSearchReset').click(function () {
            $('.xmselect_div>xm-select').find('.xm-label-block').css('display','none');
            $('.xmselect_div').append('<div class="xmselect_title">请选择</div>');
            searchTableFunc(form, table)
        });

        setSouTableExport('社保台账');
        var mytable = table.render({
            elem: "#datalist",id: "datalist"
            ,url: facade.url(ask_cert_social_tai_list),where: {year:year}, page: false, height: 'full-140'
            ,soulSort: TabInit.soulSort,method: TabInit.method, toolbar: TabInit.toolbar, overflow: TabInit.overflow
            ,defaultToolbar: TabInit.defaultToolbar,filter: TabInit.filter
            ,request: TabInit.request,response: TabInit.response,contextmenu:get_table_contextmenu(soulTable)
            ,text: TabInit.text,totalRow: true
            ,parseData: function (res) {

                render_from();
                return {
                    "code": res.code,
                    "msg": res.message,
                    "count": res.data.total,
                    "data": res.data.data
                };
            }
            , cols: [[
                {type: "checkbox", fixed: 'left'}
                ,{type:'numbers',title:'序号',totalRowText: '合计',fixed:'left'}
                ,{field:'deptname',title:'单位',templet: function(d){
                        return '<span class="colorlan" onclick="openNavPage(\'社保台账\',\'cert_social_tai/detail.php?pid='+d.pid+'&month='+d.month+'\')">'+d.deptname+'</span>';
                    }}
                ,{field: 'month', title: '月份'}
                ,{field:'renshu',title:'人数',totalRow: true,templet: function(d){
                    if(!d.xiajicheck){
                        return '<span class="colorlan" onclick="openNavPage(\'社保缴纳明细\',\'cert_social/mingxi.php?deptname='+encodeURI(d.deptname)+'&month='+d.month+'\')">'+d.renshu+'</span>';
                    }else{
                        return d.renshu;
                    }
                }}
                ,{field: 'yueshu', title: '月数',totalRow: true}
                ,{field: 'jiaofee', title: '缴费基数',totalRow: true}
                ,{field: 'yangfee', title: '养老个人缴',totalRow: true}
                ,{field: 'shifee', title: '失业个人缴',totalRow: true}
                ,{field: 'laofee', title: '养老公缴',totalRow: true}
                ,{field: 'gongfee', title: '医疗公缴',totalRow: true}
                ,{field: 'yefee', title: '失业公缴',totalRow: true}
                ,{field: 'shangfee', title: '工伤基金',totalRow: true}
                ,{field: 'lifee', title: '利息',totalRow: true}
                ,{field: 'zhifee', title: '滞纳金',totalRow: true}
                ,{field: 'gonghe', title: '公缴小计',totalRow: true}
                ,{field: 'gehe', title: '个人小计',totalRow: true}
                ,{field: 'jiaohe', title: '缴费小计',totalRow: true}
                ,{field: 'jiaohe', title: '统筹金',totalRow: true}
                ,{field: 'money', title: '合计',totalRow: true}
            ]]
            , done: function (res) {
                soulTable.render(this);
            }
        });

        listTableSearch(form, table);
    });


</script>
</body>
</html>
